package showcase

import (
	"github.com/templui/templui/internal/components/form"
	"github.com/templui/templui/internal/components/rating"
)

templ RatingForm() {
	<form class="max-w-sm mx-auto">
		@form.Item() {
			@form.Label(form.LabelProps{
				For: "product_quality",
			}) {
				Product Quality
			}
			@rating.Rating(rating.Props{
				Value:     3,
				ReadOnly:  false,
				Precision: 1.0,
				Name:      "product_quality",
			}) {
				@rating.Group() {
					for i := 1; i <= 5; i++ {
						@rating.Item(rating.ItemProps{
							Value: i,
							Style: rating.StyleStar,
						})
					}
				}
			}
			@form.Description() {
				Rate the quality of the product you received.
			}
			@form.Message(form.MessageProps{
				Variant: form.MessageVariantError,
			}) {
				Please rate the product quality.
			}
		}
	</form>
}
